home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 4
/
Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso
/
Development
/
General
/
ViewIt™ 2.24 Shareware
/
FORTRAN Demo Projects
/
LS Fortran 3.3 Demos
/
fDemoLF.f
< prev
next >
Wrap
Text File
|
1993-09-20
|
4KB
|
135 lines
C NOTE: Read the "MPW Fortrans" section of "About Compilers"
C before compiling LF programs that use FaceWare modules.
C FaceIt 2.2 Demonstration Program
C ©FaceWare 1989-93. All Rights Reserved.
C1 - run program to see on-line comments
!!M Inlines.f
C2
!!I FaceProcLF.inc
PROGRAM fDemoLF
implicit none
C NOTE: If you use the "!!G" directive for precompiled globals, add
C our FaceStorLF.inc globals to yours and then remove following line
include 'FaceStorLF.inc'
record /FaceRec/ fRec
common/FaceStuff/fRec
integer*1 keys(16)
integer*2 i,mode
integer*4 oldCount,newCount
character*256 fileName
C3
fRec.uName = 'fDemo.Rsrc'
C4
call FaceIt(0,DoInit,3,0,0,0)
C5
call FaceIt(0,NewWnd,1010,1,0,0)
call FaceIt(0,NewWnd,1020,1,0,0)
C6
call FaceIt(0,NewWnd,1030,1,0,0)
C7
call FaceIt(0,NewWnd,1040,2,0,0)
C8
do while (.true.)
call FaceIt(0,DoLoop,0,0,0,0)
C9
if (fRec.uMenuID = 101) then
C10
if (fRec.uMenuItem = 1) then
fRec.uString = 'Demonstration of the use of FaceIt'
+//char(13)//'to support program-wide features.'
call FaceIt(0,ShoStr,3,12,(1 + (409*65536)),0)
end if
C11
else if (fRec.uMenuID = 102) then
if (fRec.uMenuItem = 6) then
call FaceIt(0,GetWVC,1010,0,0,0)
call FaceIt(0,SavWnd,1010,0,0,0)
call FaceIt(0,GetWVC,1020,0,0,0)
call FaceIt(0,SavWnd,1020,0,0,0)
call FaceIt(0,GetWVC,1040,0,0,0)
call FaceIt(0,SavWnd,1040,0,0,0)
end if
C12
else if ((fRec.uMenuID >= 105).and.(fRec.uMenuID <= 1040)) then
if (fRec.uMenuItem = 1) then
call SysBeep(%val(int2(5)))
else if (fRec.uMenuItem = 2) then
call SysBeep(%val(int2(5)))
call SysBeep(%val(int2(5)))
else if (fRec.uMenuItem = 3) then
call SysBeep(%val(int2(5)))
call SysBeep(%val(int2(5)))
call SysBeep(%val(int2(5)))
C13
else if (fRec.uMenuItem = 4) then
call FaceIt(0,GetCtl,1030,0,1,4)
call FaceIt(0,PopMen,107,fRec.cRect(1)-9,fRec.cRect(2)-10,0)
C14
else if (fRec.uMenuItem = 8) then
C15
call FaceIt(0,ShoAlt,1010,0,1,1)
mode = fRec.uResult
oldCount = 0
if (mode > 1) then
do while (.true.)
C16
newCount = TickCount
if (newCount - oldCount > 180) then
call SysBeep(%val(int2(5)))
oldCount = newCount
end if
C17
if (mode = 2) then
if (GetNextEvent(%val(int2(-1)),fRec.fEvent) <> 0) then
if (fRec.fEvent(1) = 5) then
leave
else
call FaceIt(0,DoEvnt,0,0,0,0)
end if
end if
end if
C18
if (mode = 3) then
call GetKeys(keys)
if ((BitTst(keys,%val(61))<>0).and.(BitTst(keys,%val(48))<>0)) then
call FlushEvents(%val(int2(62)),%val(int2(0)))
leave
end if
end if
end do
end if
end if
C19
else if (fRec.uMenuID = 1100) then
if (fRec.uMenuItem = 2) then
if (fRec.fActiveWnd = 0) then
fRec.uString = 'No Window'
else if (fRec.fActiveID <> 1200) then
fRec.uString = 'Non-ViewIt Window'
else if (fRec.fActiveResID = 1204) then
fRec.uString = 'Help Window'
else if (fRec.fActiveResID = 1010) then
fRec.uString = 'Editor Window'
else if (fRec.fActiveResID = 1020) then
fRec.uString = 'Clipboard Window'
else if (fRec.fActiveResID = 1030) then
fRec.uString = 'Beeps Window'
end if
call FaceIt(0,SetItm2,105,10,3,0)
C20
else if (fRec.uMenuItem = 512) then
if ((fRec.uString = 'TEXT').and.(fRec.uResult = 1)) then
fileName = fRec.uName
call FaceIt(0,GetCtl,1010,0,1,1)
fRec.uName = fileName
call FaceIt(fRec.cControl,1551,0,1,0,0) !OpnCTxt
end if
end if
end if
end do
end